
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>IconFont</title>
    <link rel="stylesheet" href="demo.css">
    <script src="iconfont.js"></script>

    <style type="text/css">
        .icon {
          /* 通过设置 font-size 来改变图标大小 */
          width: 1em; height: 1em;
          /* 图标和文字相邻时，垂直对齐 */
          vertical-align: -0.15em;
          /* 通过设置 color 来改变 SVG 的颜色/fill */
          fill: currentColor;
          /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
             normalize.css 中也包含这行 */
          overflow: hidden;
        }

    </style>
</head>
<body>
    <div class="main markdown">
        <h1>IconFont 图标</h1>
        <ul class="icon_lists clear">
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-chao"></use>
                    </svg>
                    <div class="name">超</div>
                    <div class="fontclass">#icon-chao</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-mgtv"></use>
                    </svg>
                    <div class="name">M</div>
                    <div class="fontclass">#icon-mgtv</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-movie"></use>
                    </svg>
                    <div class="name">电影票</div>
                    <div class="fontclass">#icon-movie</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-map"></use>
                    </svg>
                    <div class="name">地图</div>
                    <div class="fontclass">#icon-map</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-yotube"></use>
                    </svg>
                    <div class="name">youtube</div>
                    <div class="fontclass">#icon-yotube</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-taobao"></use>
                    </svg>
                    <div class="name">淘宝</div>
                    <div class="fontclass">#icon-taobao</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-wangyi"></use>
                    </svg>
                    <div class="name">网易</div>
                    <div class="fontclass">#icon-wangyi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-amap"></use>
                    </svg>
                    <div class="name">纸飞机</div>
                    <div class="fontclass">#icon-amap</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-weibo"></use>
                    </svg>
                    <div class="name">新浪</div>
                    <div class="fontclass">#icon-weibo</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-bug"></use>
                    </svg>
                    <div class="name">bug</div>
                    <div class="fontclass">#icon-bug</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-website"></use>
                    </svg>
                    <div class="name">官方网站</div>
                    <div class="fontclass">#icon-website</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-bbs"></use>
                    </svg>
                    <div class="name">bbs_selected</div>
                    <div class="fontclass">#icon-bbs</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-g"></use>
                    </svg>
                    <div class="name">谷歌_google114</div>
                    <div class="fontclass">#icon-g</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-tmallShop"></use>
                    </svg>
                    <div class="name">天猫 T</div>
                    <div class="fontclass">#icon-tmallShop</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-sina"></use>
                    </svg>
                    <div class="name">YDUI-新浪微博</div>
                    <div class="fontclass">#icon-sina</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-souhu"></use>
                    </svg>
                    <div class="name">搜狐</div>
                    <div class="fontclass">#icon-souhu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-ithome"></use>
                    </svg>
                    <div class="name">IT之家</div>
                    <div class="fontclass">#icon-ithome</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-acfun"></use>
                    </svg>
                    <div class="name">acfun</div>
                    <div class="fontclass">#icon-acfun</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-tmall"></use>
                    </svg>
                    <div class="name">天猫</div>
                    <div class="fontclass">#icon-tmall</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-youku"></use>
                    </svg>
                    <div class="name">优酷</div>
                    <div class="fontclass">#icon-youku</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-iqiyi"></use>
                    </svg>
                    <div class="name">爱奇艺</div>
                    <div class="fontclass">#icon-iqiyi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-video"></use>
                    </svg>
                    <div class="name">视频</div>
                    <div class="fontclass">#icon-video</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-baidu"></use>
                    </svg>
                    <div class="name">百度</div>
                    <div class="fontclass">#icon-baidu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-zhihu"></use>
                    </svg>
                    <div class="name">知乎</div>
                    <div class="fontclass">#icon-zhihu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-pear"></use>
                    </svg>
                    <div class="name">梨-Pear</div>
                    <div class="fontclass">#icon-pear</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-gmap"></use>
                    </svg>
                    <div class="name">752编辑器_谷歌地图</div>
                    <div class="fontclass">#icon-gmap</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-bmap"></use>
                    </svg>
                    <div class="name">751编辑器_百度地图</div>
                    <div class="fontclass">#icon-bmap</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-baidu-c"></use>
                    </svg>
                    <div class="name">百度1</div>
                    <div class="fontclass">#icon-baidu-c</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-api"></use>
                    </svg>
                    <div class="name">API文档</div>
                    <div class="fontclass">#icon-api</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-le"></use>
                    </svg>
                    <div class="name">乐视</div>
                    <div class="fontclass">#icon-le</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-163"></use>
                    </svg>
                    <div class="name">网易</div>
                    <div class="fontclass">#icon-163</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-git"></use>
                    </svg>
                    <div class="name">git</div>
                    <div class="fontclass">#icon-git</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-mil"></use>
                    </svg>
                    <div class="name">军事</div>
                    <div class="fontclass">#icon-mil</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-dji"></use>
                    </svg>
                    <div class="name">dji</div>
                    <div class="fontclass">#icon-dji</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-bilibiliTv"></use>
                    </svg>
                    <div class="name">CN_bilibili B</div>
                    <div class="fontclass">#icon-bilibiliTv</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-acfuntv"></use>
                    </svg>
                    <div class="name">CN_acfun.tv</div>
                    <div class="fontclass">#icon-acfuntv</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-bilibili"></use>
                    </svg>
                    <div class="name">BILIBILI_LOGO</div>
                    <div class="fontclass">#icon-bilibili</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-gg"></use>
                    </svg>
                    <div class="name">谷歌</div>
                    <div class="fontclass">#icon-gg</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-newspaper"></use>
                    </svg>
                    <div class="name">新闻</div>
                    <div class="fontclass">#icon-newspaper</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-jddog"></use>
                    </svg>
                    <div class="name">京东</div>
                    <div class="fontclass">#icon-jddog</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-bing"></use>
                    </svg>
                    <div class="name">bing</div>
                    <div class="fontclass">#icon-bing</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-jd"></use>
                    </svg>
                    <div class="name">AK-SR京东</div>
                    <div class="fontclass">#icon-jd</div>
                </li>
            
        </ul>


        <h2 id="symbol-">symbol引用</h2>
        <hr>

        <p>这是一种全新的使用方式，应该说这才是未来的主流，也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
        这种用法其实是做了一个svg的集合，与另外两种相比具有如下特点：</p>
        <ul>
          <li>支持多色图标了，不再受单色限制。</li>
          <li>通过一些技巧，支持像字体那样，通过<code>font-size</code>,<code>color</code>来调整样式。</li>
          <li>兼容性较差，支持 ie9+,及现代浏览器。</li>
          <li>浏览器渲染svg的性能一般，还不如png。</li>
        </ul>
        <p>使用步骤如下：</p>
        <h3 id="-symbol-">第一步：引入项目下面生成的symbol代码：</h3>
        <pre><code class="lang-js hljs javascript"><span class="hljs-comment">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;</span></code></pre>
        <h3 id="-css-">第二步：加入通用css代码（引入一次就行）：</h3>
        <pre><code class="lang-js hljs javascript">&lt;style type=<span class="hljs-string">"text/css"</span>&gt;
.icon {
   width: <span class="hljs-number">1</span>em; height: <span class="hljs-number">1</span>em;
   vertical-align: <span class="hljs-number">-0.15</span>em;
   fill: currentColor;
   overflow: hidden;
}
&lt;<span class="hljs-regexp">/style&gt;</span></code></pre>
        <h3 id="-">第三步：挑选相应图标并获取类名，应用于页面：</h3>
        <pre><code class="lang-js hljs javascript">&lt;svg <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"icon"</span> aria-hidden=<span class="hljs-string">"true"</span>&gt;<span class="xml"><span class="hljs-tag">
  &lt;<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#icon-xxx"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">use</span>&gt;</span>
</span>&lt;<span class="hljs-regexp">/svg&gt;
        </span></code></pre>
    </div>
</body>
</html>
